//
//  RoomInfoViewController.m
//  HallOrder
//
//  Created by 蒋 浩锋 on 12-10-20.
//  Copyright (c) 2012年 蒋 浩锋. All rights reserved.
//
#define CELL_FONTSIZE 12
#define CELL_FONT(s)        [UIFont fontWithName : @"Helvetica-Oblique" size : s]
#define CELL_BOLDFONT(s)    [UIFont fontWithName : @"Helvetica-Bold" size : s]

#import "RoomInfoViewController.h"
#import "NewFoodOrder/OrderMainViewController.h"
#import "Plugin/PrettyKit/Cells/PrettyCustomViewTableViewCell.h"

@interface RoomInfoViewController ()

@end

@implementation RoomInfoViewController
@synthesize roomStateObj;
@synthesize roomInfoObj, popover, delegate;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self)
    {
        // Custom initialization
    }

    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableView.rowHeight = 30;
    self.tableView.sectionHeaderHeight = 2;
    self.tableView.sectionFooterHeight = 10;
    self.tableView.scrollEnabled = NO;
    self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]];
    __unsafe_unretained __block RoomInfoViewController *safeSelf = self;
    [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
            section.title = @"房台信息";
            [section addCell:^(JMStaticContentTableViewCell * staticContentCell, PrettyTableViewCell * cell, NSIndexPath * indexPath) {
                    staticContentCell.cellStyle = UITableViewCellStyleValue1;
                    staticContentCell.reuseIdentifier = @"DetailTextCell";
                    cell.selectionStyle = UITableViewCellSelectionStyleNone;
                    cell.textLabel.text = NSLocalizedString (@"房台号", @"房台号");
                    cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                    cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                    cell.detailTextLabel.text = safeSelf.roomStateObj.RoomNo;
                }];
            [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                    staticContentCell.cellStyle = UITableViewCellStyleValue1;
                    staticContentCell.reuseIdentifier = @"DetailTextCell";
                    cell.textLabel.text = @"房台类";
                    cell.detailTextLabel.text = safeSelf.roomStateObj.Retain8;
                    cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                    cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                } whenSelected:^(NSIndexPath * indexPath) {
                    // TODO
                }];
            [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                    staticContentCell.cellStyle = UITableViewCellStyleValue1;
                    staticContentCell.reuseIdentifier = @"DetailTextCell";
                    cell.selectionStyle = UITableViewCellSelectionStyleNone;

                    cell.textLabel.text = @"最低消费";
                    cell.detailTextLabel.text = safeSelf.roomStateObj.LowLimitMoney;
                    cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                    cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                }];
            [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                    staticContentCell.cellStyle = UITableViewCellStyleValue1;
                    staticContentCell.reuseIdentifier = @"DetailTextCell";
                    cell.selectionStyle = UITableViewCellSelectionStyleNone;

                    cell.textLabel.text = @"房台状态";

                    cell.detailTextLabel.text = safeSelf.roomStateObj.StateTitle;
                
                    cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                    cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                }];
        }];

    /*
     *   0: 空房：RoomState=Null And RoomFlag <>1 And RoomFlag <>6 And Room_IFBad<>1
     *   1: 带位房：(RoomState =Null Or RoomState=R) And (RoomFlag=1)
     *   2: 预订房：RoomState =R And RoomFlag<>1
     *   3: 已开房：RoomState =I
     *   4: 结帐房：RoomState =S
     *   5: 清洁房：RoomState =L
     *   6: 并台房：RoomState =Null And RoomFlag=6
     *   7:维修房：RoomState =Null And Room_IfBad=1
     */
    switch (self.roomStateObj.room_State)
    {
        case 0:
            {
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleDefault;
                            //                        staticContentCell.reuseIdentifier = @"DetailTextCell";
                            staticContentCell.cellHeight = 40;
                            cell.textLabel.text = NSLocalizedString (@"房台带位", @"房台带位");
                            cell.backgroundColor = [UIColor darkGrayColor];
                            cell.textLabel.textAlignment = UITextAlignmentCenter;
                            cell.textLabel.textColor = [UIColor whiteColor];
                        } whenSelected:^(NSIndexPath * indexPath)
                        {
                            [safeSelf DaiWeiAction];
                        }];
                }];
            }
            break;

        case 1:
            {
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleDefault;
                            //                        staticContentCell.reuseIdentifier = @"DetailTextCell";
                            staticContentCell.cellHeight = 40;
                            cell.textLabel.text = NSLocalizedString (@"取消带位", @"取消带位");
                            cell.backgroundColor = [UIColor darkGrayColor];
                            cell.textLabel.textAlignment = UITextAlignmentCenter;
                            cell.textLabel.textColor = [UIColor whiteColor];
                        } whenSelected:^(NSIndexPath * indexPath) {
                            [safeSelf CancelLeadRoomAction];
                        }];
                }];
            }
            break;

        case 2:
            {
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    section.title = @"预定信息";
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.textLabel.text = NSLocalizedString (@"定位经理", @"定位经理");
                            cell.detailTextLabel.text = safeSelf.roomStateObj.ReserveClerk;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];

//                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                            staticContentCell.reuseIdentifier = @"DetailTextCell";
//                            cell.textLabel.text = NSLocalizedString (@"部门分组", @"部门分组");
//                            cell.detailTextLabel.text = self.roomStateObj.ReserveClerkGroup;
//                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                        } whenSelected:^(NSIndexPath * indexPath) {
//                            // TODO
//                        }];

//                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                            staticContentCell.reuseIdentifier = @"DetailTextCell";
//                            cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                            cell.textLabel.text = @"公关模特";
//                            cell.detailTextLabel.text = self.roomStateObj.RewardClerk;
//                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                        } whenSelected:^(NSIndexPath * indexPath) {
//                            // TODO
//                        }];

                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"客人姓名";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GuestName;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"预定时间";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.ReserveDateTime;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"抵达时间";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.ArriveDateTime;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"客人人数";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GuestCount;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                }];
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleDefault;
                            //                        staticContentCell.reuseIdentifier = @"DetailTextCell";
                            staticContentCell.cellHeight = 40;
                            cell.textLabel.text = NSLocalizedString (@"房台带位", @"房台带位");
                            cell.backgroundColor = [UIColor darkGrayColor];
                            cell.textLabel.textAlignment = UITextAlignmentCenter;
                            cell.textLabel.textColor = [UIColor whiteColor];
                        } whenSelected:^(NSIndexPath * indexPath) {
                            [safeSelf DaiWeiAction];
                        }];
                }];
            }
            break;

        case 3:
            {
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    section.title = @"预定信息";
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.textLabel.text = NSLocalizedString (@"定位经理", @"定位经理");
                            cell.detailTextLabel.text = safeSelf.roomStateObj.ReserveClerk;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            //                    cell.imageView.image = [UIImage imageNamed:@"Sounds"];
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];

//                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                            staticContentCell.reuseIdentifier = @"DetailTextCell";
//                            cell.textLabel.text = NSLocalizedString (@"部门分组", @"部门分组");
//                            cell.detailTextLabel.text = self.roomStateObj.ReserveClerkGroup;
//                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                        } whenSelected:^(NSIndexPath * indexPath) {
//                            // TODO
//                        }];

//                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                            staticContentCell.reuseIdentifier = @"DetailTextCell";
//                            cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                            cell.textLabel.text = @"公关模特";
//                            cell.detailTextLabel.text = self.roomStateObj.RewardClerk;
//                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                        } whenSelected:^(NSIndexPath * indexPath) {
//                            // TODO
//                        }];

                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"客人姓名";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GuestName;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"开台时间";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.CheckInDateTime;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.selectionStyle = UITableViewCellSelectionStyleNone;

                            cell.textLabel.text = @"客人人数";
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GuestCount;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                }];
                [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.textLabel.text = NSLocalizedString (@"公关带位", @"公关带位");
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GongGuanLeaderName;
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            //                    cell.imageView.image = [UIImage imageNamed:@"Sounds"];
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];

                    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                            staticContentCell.cellStyle = UITableViewCellStyleValue1;
                            staticContentCell.reuseIdentifier = @"DetailTextCell";
                            cell.textLabel.text = NSLocalizedString (@"公关人数", @"公关人数");
                            cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
                            cell.detailTextLabel.text = safeSelf.roomStateObj.GongGuanCount;
                        } whenSelected:^(NSIndexPath * indexPath) {
                            // TODO
                        }];
                }];

                if (![roomStateObj.MT_PreSettleFlag isEqualToString:@"1"])
                {
                    [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                                staticContentCell.cellStyle = UITableViewCellStyleDefault;
                                //                        staticContentCell.reuseIdentifier = @"DetailTextCell";
                                staticContentCell.cellHeight = 40;
                                cell.textLabel.text = NSLocalizedString (@"包房点单", @"包房点单");
                                cell.backgroundColor = [UIColor darkGrayColor];
                                cell.textLabel.textAlignment = UITextAlignmentCenter;
                                cell.textLabel.textColor = [UIColor whiteColor];
                            } whenSelected:^(NSIndexPath * indexPath)
                            {
                                [safeSelf.delegate showOrderViewController];
                            }];
                    }];
                }
            }
            break;

        case 4:
            {
                if ([ROOMTYPE isEqualToString:@"2"] && [roomStateObj.MT_PreSettleFlag isEqualToString:@"1"])
                {
//                    [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
//                        section.title = @"预定信息";
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.textLabel.text = NSLocalizedString (@"定位经理", @"定位经理");
//                                cell.detailTextLabel.text = self.roomInfoObj.ReserveClerk;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                //                    cell.imageView.image = [UIImage imageNamed:@"Sounds"];
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.textLabel.text = NSLocalizedString (@"部门分组", @"部门分组");
//                                cell.detailTextLabel.text = self.roomInfoObj.ReserveClerkGroup;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                                cell.textLabel.text = @"公关模特";
//                                cell.detailTextLabel.text = self.roomInfoObj.RewardClerk;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                                cell.textLabel.text = @"客人姓名";
//                                cell.detailTextLabel.text = self.roomInfoObj.GuestName;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                                cell.textLabel.text = @"开台时间";
//                                cell.detailTextLabel.text = self.roomStateObj.CheckInDateTime;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.selectionStyle = UITableViewCellSelectionStyleNone;
//
//                                cell.textLabel.text = @"客人人数";
//                                cell.detailTextLabel.text = self.roomInfoObj.ManCount;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//                    }];
//                    [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.textLabel.text = NSLocalizedString (@"公关带位", @"公关带位");
//                                cell.detailTextLabel.text = self.roomInfoObj.GongGuanLeaderName;
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                //                    cell.imageView.image = [UIImage imageNamed:@"Sounds"];
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//
//                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
//                                staticContentCell.cellStyle = UITableViewCellStyleValue1;
//                                staticContentCell.reuseIdentifier = @"DetailTextCell";
//                                cell.textLabel.text = NSLocalizedString (@"公关人数", @"公关人数");
//                                cell.textLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.font = CELL_BOLDFONT (CELL_FONTSIZE);
//                                cell.detailTextLabel.text = self.roomInfoObj.GongGuanCount;
//                            } whenSelected:^(NSIndexPath * indexPath) {
//                                // TODO
//                            }];
//                    }];
                    [self addSection:^(JMStaticContentTableViewSection * section, NSUInteger sectionIndex) {
                        [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
                                staticContentCell.cellStyle = UITableViewCellStyleDefault;
                                //                        staticContentCell.reuseIdentifier = @"DetailTextCell";
                                staticContentCell.cellHeight = 40;
                                cell.textLabel.text = NSLocalizedString (@"包房点单", @"包房点单");
                                cell.backgroundColor = [UIColor darkGrayColor];
                                cell.textLabel.textAlignment = UITextAlignmentCenter;
                                cell.textLabel.textColor = [UIColor whiteColor];
                            } whenSelected:^(NSIndexPath * indexPath)
                            {
                                [safeSelf.delegate showOrderViewController];
                            }];
                    }];
                }
            }

        default:

            break;
    }

    [SocketDataHandle sharedInstance].delegate = self;
//
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

- (void)socketDataHandleDidRoomStateAndInfo:(RoomStateAndInfo *)roomStateInfo
{}

- (void)addTableViewCell:(JMStaticContentTableViewSection *)section title:(NSString *)title value:(NSString *)value
{
    [section addCell:^(JMStaticContentTableViewCell * staticContentCell, UITableViewCell * cell, NSIndexPath * indexPath) {
            staticContentCell.cellStyle = UITableViewCellStyleValue1;
            staticContentCell.reuseIdentifier = @"DetailTextCell";
            cell.textLabel.text = title;
            cell.detailTextLabel.text = value;
            cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
            cell.detailTextLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
        } whenSelected:^(NSIndexPath * indexPath) {
            // TODO
        }];
}

- (void)CancelLeadRoomAction
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"密码输入" message:@"输入您的密码" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil];

    alert.alertViewStyle = UIAlertViewStyleSecureTextInput;
    [alert textFieldAtIndex:0].keyboardType = UIKeyboardTypeNumberPad;
    alert.tag = rtCancelLeadRoom;
    [alert show];
    [self.delegate disMiss];
}

- (void)DaiWeiAction
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"输入您的密码" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil];

    alert.alertViewStyle = UIAlertViewStyleSecureTextInput;
    [alert textFieldAtIndex:0].keyboardType = UIKeyboardTypeNumberPad;
    alert.tag = rtLeadRoom;
    [alert show];
    [self.delegate disMiss];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 0)
    {
        if (alertView.tag == rtLeadRoom)
        {
            [[ServerNetworkCenter sharedInstance] sentMsg:rtLeadRoom:@"0", [DataCenter sharedInstance].clerkNo, [alertView textFieldAtIndex:0].text, roomStateObj.RoomNo, nil];
        }
        else
        if (alertView.tag == rtCancelLeadRoom)
        {
            [[ServerNetworkCenter sharedInstance] sentMsg:rtCancelLeadRoom:@"0", [DataCenter sharedInstance].clerkNo, [alertView textFieldAtIndex:0].text, roomStateObj.RoomNo, nil];
        }
    }
}

@end